I found a solution. See http://stackoverflow.com/questions/335928/linux-gcc-linking-ld-cannot-find-a-library-that-exists For me, I needed readline and history, so I did this: $ cd /lib $ sudo ln -s libreadline.so.5 libreadline.so $ sudo ln -s libhistory.so.5 libhistory.so After that, ld didn't complain.