Fix build platform detection on Mac