Fixed build script for mac