Sorry for the mess w.r.t. this build.h issue. I did a full gitian build and normal builds to make sure it worked, but apparently other environments existed as well (see #1076).
This pull request contains a few extra changes to fix all issues I'm currently aware of.
For Qt builds, the build.h file is moved to build/build.h. For regular builds, it is moved to obj/build.h. This allows the Qt build to be done in a different directory than the source, and without interfering with other builds.