Fix linker issues of CMake