Changes for building with 10.9 SDK and on 10.10
More cleanups to the build file.

Thanks @pajp