Refactor Makefile.am to move common files from 3 libraries into a single variable.