Make it possible to build empty libraries again.

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