[Build] optimise configure machine detection.