Add proper dependency checking, so that parallel builds work.

This also lets you build individual library files, rather than aliases.