Use -O instead of +O3 or +O2. Remove +Oaggressive. Replace -Aa with -Ae.
Replaced $(LIB_DIR) with $(TOP)/$(LIB_DIR), use LIB_DIR in install targets. Patch by Hanno Böck.