Make it possible to build empty libraries again.

Restores old behaviour broken by @igfoo in
8395c5db800284c9e2b54b5c45b94c4a3bfdfcf2. Fixes #1241.