Support building "libraries"

These libraries are actually just JAR files that are installed to
LIBDIR, but they act somewhat like libraries.