imsqam is correct - your best bet would be to build, but failing that, you might want to save your money initially & 'pull the trigger' when you've got more funds.
$400 doesn't get you much in the pre-build sense and, unfortunately even less building your own (considering you have to factor in around $100 for the OS when OEMs get bulk licensing).
With prebuilts available around $400, the PSU is likely going to be a big headache - you'll likely need to replace it (as it's be either minimal wattage or poor quality) with 'cheap' OEM builds. Worst case, you buy a pre-built with a proprietary PSU (I believe HP and Dell for some models) meaning any PSU upgrade would have to be done fairly expensively through those OEMs.
You then have the consideration of whether a specific GPU will fit inside the case - worse case you have to move everything over to a new housing.
A pre-built can be used for what you want - but I wouldn't recommend it at $400. I would suggest waiting a while, get some cash together. Then you can either build yourself, or buy a better pre-built.
Something like this ASUS
http://www.amazon.com/M32CD-Desktop-Windows-Keyboard-Mouse/dp/B014QVM2KO/ref=lp_565098_1_1?s=pc&ie=UTF8&qid=1455658001&sr=1-1 which i believe is either the same or similar to imsqam linked would be your best bet at $450, but comes with a 300W PSU you'd be replacing.