make build script work on OS X & Linux