append CFLAGS instead of force-set it, this was distributions
can also add their own CFLAGS in addition (this is very common).
introduce LDFLAGS so distributions can set their own additional
flags for the linker and append instead of set (this is very common)
replace static /usr/local/lib with a PREFIX variable with default
value of /usr/local so a distribution can easily use PREFIX=/usr
(this is also common)
introduce DESTDIR for distribution wide packaging as they build in
chroots and deploy into a special directory structure that will later
put into a tarball and lands in a distribution package.
f.e. DESTDIR="/build/package" (this is also common for packaging)
adding -D to install call to create all leading components of the
destination. This is very important if the DESTDIR is set for
packaging the therefor the structure does not yet exists. This will
then basically freate the directory structure. in case DESTDIR is not
used and /usr/local/lib f.e. already exists this will do nothing
this is highly common to do it this way.
We add the ${TARGET} to the end because we use the -D parameter and
therefor we need to also pass the resulting filename