Check AM_PROG_AR exists before calling

Not actually required for (and breaks) mingw builds