make: optionally add gcc lto flags

This commit enables building using link time optimization when
specifying "LTO=yes" in the application's Makefile.