Make sure LDFLAGS are also used for linking
Small code simplification