Makefile: clean up variables

- replace $(LIBS) by $(LDFLAGS)
- use override to handle CPPFLAGS, CFLAGS, LDFLAGS
    This allows to append flags to the users input.
- remove unused $(DIFF)

Change-Id: I1c9e869377677d624469af1ee9ece9a28fc3b559
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/59230
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72282
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/Makefile b/Makefile
index 7bd8839..b106a02 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,6 @@
 STRIP   ?= strip
 STRIP_ARGS = -s
 INSTALL = install
-DIFF    = diff
 PREFIX  ?= /usr/local
 MANDIR  ?= $(PREFIX)/share/man
 CFLAGS  ?= -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings
@@ -267,7 +266,7 @@
 EXEC_SUFFIX := .exe
 # DJGPP has odd uint*_t definitions which cause lots of format string warnings.
 override CFLAGS += -Wno-format
-LIBS += -lgetopt
+override LDFLAGS += -lgetopt
 # Missing serial support.
 $(call mark_unsupported,$(DEPENDS_ON_SERIAL))
 endif
@@ -797,7 +796,7 @@
 
 ifneq ($(NEED_POSIX_SOCKETS), )
 ifeq ($(TARGET_OS), SunOS)
-LIBS += -lsocket -lnsl
+override LDFLAGS += -lsocket -lnsl
 endif
 endif
 
@@ -876,7 +875,7 @@
 
 ifeq ($(HAS_CLOCK_GETTIME), yes)
 FEATURE_CFLAGS += -D'HAVE_CLOCK_GETTIME=1'
-FEATURE_LIBS += -lrt
+override LDFLAGS += -lrt
 endif
 
 LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
@@ -888,7 +887,7 @@
 endif
 
 $(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
-	$(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LDFLAGS) $(LIBS) $(FEATURE_LIBS)
+	$(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LDFLAGS)
 
 libflashrom.a: $(LIBFLASHROM_OBJS)
 	$(AR) rcs $@ $^