Fix build script for Linux/OS X