As suggested by @genjix, here are my suggested changes for his original PR (#10).
They’re minor changes, I have no qualms with them being squashed into the original commit.
It was not necessary and would only confuse packagers.
Set the private libs as determined by configure, and add the missing lib link.