I tried to solve the problem by adding following line to cmake.list but it didn't also work.
FIND_LIBRARY(MY_LIB NAMES library
PATHS /path/to)
TARGET_LINK_LIBRARIES(program ${MY_LIB})
I solved the problem just adding .so files with their full path:
LibCreate_CANReceive(&can_reciever_DW.CANReceive_CANReceive[0U], "kvaser",
"libmwslkvaserwrapper.so", "Kvaser Leaf Light v2",
88054, 48, 1, 1, "~/catkin_ws/src/c_simulink_can/include/can_kvaser/R2021a/toolbox/vnt/vnt/private/glnxa64/libmwcanslconverter.so",
"~/catkin_ws/src/c_simulink_can/include/can_kvaser/R2021a/toolbox/vnt/vnt/private/glnxa64/libmwkvasercanlibplugin.so", 500000.0, &bitParams[0U],
0, 0, &stdIDs, 1, 0, &extIDs, 1, &stdIDsStart,
&stdIDsEnd, 1, &idMaskParams[0U], 0);