Fix for issue #187: Build failure out of source directory

This PR addresses the problems mentioned in #187.