fix BUILD_MACHINE architecture detection for mac and cross-build (reverts b038d4c3cf7220738a8f7c14c559fe34f4470d4c)