Instead of linking the lib folder with the libraries, link the lib directory from the dev output containing the pkgconfig files. This is enough for finding the libs and fixes a build failure with libressl.