List only dependencies which are linked by one of the libraries or included
in one of the headers.