build: use AM_PROG_AR conditionally

AM_PROG_AR does not exist in automake v0.11 but without it, you can't
build libuv with automake v0.12+ on Darwin.