Check and apply -Wno-old-style-cast for Apple clang 4.0 and autotools.

Complement of #433.
#433 is for cmake, this PR is for autotools.