modifications necessary to make script work on with NDK-8e on Mac OSX 10.8 (64-bit)