cmake: fix build by reordering the cflags definitions