use `$AR` instead of `ar` in scripts in scripts

This allows users to set their own AR for cross building.