I believe those Could not find dynamic library
messages are just warnings. You can fix them by passing (in my case) --ld-search-path=/lib/x86_64-linux-gnu
, where the search path is found by invoking find /usr/lib -name libpthread.so
or find /lib -name libpthread.so