tweaks and fixes for OSX build script (sysroot, compat)