A few build system improvements

fixes #66