configure.ac: Test for existence of AM_PROG_AR macro

The inclusion of AM_PROG_AR macro broke Automake 1.11.1 on Debian
Squeeze.  Now test for its existence and only call it when it is
defined.