Use AM_CFLAGS
add osx
Update to latest upstream