Fixes #709, out-of-source builds from arbitrary directories