Fix cmake to use pkgconfig if available