For some reason library paths are not set at all for some libraries during the build. Wrapper with LD_LIBRARY_PATH set for relevant libraries is currently solution.