Use AX_CHECK_COMPILE_FLAG to detect -maes

With this commit the check for -maes is similar to the other compiler flag checks.