Since Octave 7, LDFLAGS as returned by mkoctfile include -shared, which is undesirable for generic LDFLAGS. Pass the --link-stand-alone option to strip this flag.