added $CFLAGS; fixed build order