fix BUILD_MACHINE on darwin, or when CC != clang

Fixes "libgmp not found or uses a different ABI (including static vs
shared)" error.