Setup for out-of-source builds

Allows for building in a directory specified through an environment variable.