fix CMake link library problems