Fix linkage with --as-needed.
When using the --as-needed linker flag only libraries that are actually used are linked into the final build product. With this flag enabled the order of arguments passed to the linker matters, because input files mentioned after the library on the command line are simply ignored. The fix is to simply move LDFLAGS after the input files.
The flag is enabled by default on Ubuntu which causes the Arduino IDE to fail with an undefined symbol error on start as reported in: https://bugs.launchpad.net/ubuntu/+source/arduino/+bug/1916278
I think it would make sense to fix this in Debian as well since it should cause no harm in the worst case and in the best case prevents future trouble when someone tries to introduce --as-needed.