Detect Apple toolchain instead of relying on uname

This allows cross-compiling for Android on a Mac.