OSX build: Added more flexible toolchain support for more recent OS X and xCode versions.