TLDR: Check the link.txt under CMakeFiles/ dir, see if there is a unexpected library linked. The library linked should be user-known.
In my case, CMake automatically found the glog/gflags under /opt/anaconda3 and linked to the .so under it, and then this error occurs. I recommend to revise the CMakeList.txt, regenerate CMakeCache.txt and try make again.
So please check your link.txt under CMakeFiles/ dir for more details. In my case, checking the link.txt did help!
enter image description here
Once correct 3rd libraries linked, everything went well.