Fix Makefile.am to explicitly add dependent libraries