1. Add -lstdc++ to LDFLAGS.
2. Add "-Wl,--gc-sections,--as-needed" to LDFLAGS and "-ffunction-sections -fdata-sections -flto" to CFLAGS which will reduce the size by 10% ~ 13%.
3. Only a virtual package will be created if only static libs are built, which will avoid compiliation failures.
4. Other improvements
Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>