Made makefile respect CFLAGS/LDFLAGS.

Patch from josch - thanks.
More Makefile tweaks to make Debian/Ubuntu happy.