Add support pkg-config when using dependencies.

Add support for pkg-config. This is necessary to compile packages like poppler.

It's written by @yrb, I tried it myself and it works very well.