fix check_compiler when cross-compiling

the compiler is not installed on target when cross-compiling