Modify build script to work on MacOS.