Changed algorithm for locating shared libraries - using Cmake configure_file()