the attached patch tweaks the makefile so that it respects CFLAGS set in the environment and it makes sure to link the shared libsparse with $(LDFLAGS) -mike