Fix binary directory used in CMake try_compile commands

Old paths can have problems with cross-compilation