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

This PR only addresses a part of the problems mentioned in #187. We still need to get python wrappers working inside the build directory.