Fix dynamic linking for non-Debian Linux (#4713)
Fix dynamic linking for non-Debian Linux (#4713)

Line 167 in CMakeLists.txt causes libraries to be put into `/lib`.
Line 110, before this patch, causes binaries to look for libraries in `/${CMAKE_INSTALL_LIBDIR}`. This works out if CMAKE_INSTALL_LIBDIR equals `/lib`, which is the case on non-Linux and on Debian, see https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/GNUInstallDirs.cmake#L221. On non-Debian Linux systems, however, it causes dynamic linking to fail unless `export LD_LIBRARY_PATH=/path/to/binaryen/lib` is manually set in the shell (or a `lib64 ->lib` symlink is created inside the Binaryen checkout). This patch fixes the inconsistency by putting `/lib` as the library search path into the created binaries.
(I suppose an alternative fix would be to update lines 167/168 to use `${CMAKE_INSTALL_LIBDIR}` instead, not sure if that would be preferable.)
WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen