fix autoconf rebuild err and compile warnings

Hi

First I got error due to older autoreconf on our RHEL6.4.

Seems in old autoconf version, AM_PROG_AR shoule be m4_pattern_allow([AM_PROG_AR], [AM_PROG_AR])

and fix some compile warnings:
    unused parameter
    unsigned int <=> int