Use $(AR) instead of explicitly calling 'ar'

This simplifies overriding the command used, e.g. for cross
compilation.