based on a patch from Jan Engelhardt
From Jan Engelhardt
This makes building and testing easier because the library Makefile.am files are use directly rather than as templates. Thanks to Wouter Clarie for the idea.