Bugfix: AM_PROG_AR is not recognized by older automake, so only use it when defined