Better cleanup rules in Makefile.

Also, don't rebuild libraries every single time.