Minimum changes required to do "VPATH build"

I had to make these changes to build in a directory other than the source code directory. I only changed what was required to allow `make distcheck` to pass.