configure: compatibility with automake 1.12

AM_PROG_AR should be used. The reason seems a bit obscure. This should
be done in libtool.