Fix propagation of cmake dependencies to the generated pkgconfig files

This fixes a few issues that broke propagation CMAKE and PLAIN dependencies to the pkg-config files.