Build only lib from package

Fixes #724 

Can you also add a test for `--lib` but no libraries exist so an error is generated?