Autotools: Fix MinGW cross-compilation

With these changes I could cross-compile for Windows (but the paths in the resulting executable were incorrect, because for some reason we use different tree structure on Windows for now -- see @codebrainz mail on the ML).

This also reduces the amount of build system code that is different for Windows by building the plugins with Libtool on Windows too, as we do everywhere else.