Fix a few external dependencies detection.

Hello, would you consider to merge this commit? It specify to check a few pkg-config based dependencies based on the fact that pkg-config is available, not on the condition the OS is Linux (since they can be available on other systems such as BSDs or osX).

Thanks