Update build script with OSX and --prefix support.