guard symbol usage of link.h only when we have it

This should fix compilation on mac os, where we have no link.h. Note that
we are not calling get_names_of_shared_libs() in this case anyway.
Merge pull request #222 from tjhei/mac_link_h_fix2

guard symbol usage of link.h only when we have it