add support for OS X in the build script

X-Authored-By: @npinchot
X-Authored-By: @mn4367