Fix pkg register complaining about shared libraries not found

Fixes: #656