That machine can score $350 easily on eBay, or $400+ if you are patient and are willing to sell it as parts, piece by piece. Whoever threw it may either be stupid, or had a fight with his family and his family threw it out (quite common in China, daddy throws kid's computer out, usually smashed, or sells it for cheap).
That being said, if you want to OC it to 4.0GHz, get a better PSU and a better cooler. Personally I would sell it rather than keep it since it's way too power hungry. The latest Intel 8700K CPU can turbo boost to 4.3GHz for all 6 cores, and to 4.7GHz for single core, while still fitting in a 95W power envelope. It's said that its multicore performance is better than R7 1800X from leaked tests.