All Makefile.am contain an ugly hack which overrides
$(libdir) with $(prefix)/lib/multilib in order to
define an install location for the plugins. This breaks
on platforms where $(libdir) is not /usr/lib, e.g.
AMD64. Find attached a patch which does it the right
way. The patch includes recreated Makefile.in templates
too, so concentrate on the changes in the Makefile.am.
patch to fix plugin dir in Makefiles