Factor out routine that converts lib list to cmdline

This routine is useful in its own rights and should be made available as
a function that others can call too.
Write cmdline in .pc file without abs paths

When passing libraries to gcc/ld, the search path and library name must
be specified separately. This is already done when writing a libtool .la
and should be done in the pkg-config .pc file too.
Merge pull request #220 from rolk/220_pkgconf

Make pkg-config functional again