Ok, this first issue can be fixed with
CFLAGS="-std=gnu99" lib/make/configure --prefix=$prefix --host=$target