Use AM_CFLAGS to not override CFLAGS user variable. Improves compilation support for SmartOS