Add cross build support (relying in compiler's -dumpmachine).
Misc tweaks to not break native builds and improve cross builds.

- When running build.sh make sure we don't use CFLAGS from env (might have cross cflags).
- When testing for compiler features, test the compiler's target not native.
- If HOST_CC is clang, or CC is gcc or not set, use native tools in toolchain wrappers.