Do not build dependencies of static libraries. Fixes #316.