configure: Check if AM_PROG_AR is defined.

It's not defined when using old versions of automake.