Improve build process on OSX