Pass CFLAGS to linker

It happens that people use flags in CFLAGS that do affect the linking
stage. There is not always a clear distinction which do and which don't
so it's safer to have CFLAGS in linking commands as well.

[ Reworked to make it use generic make rule ]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>