Currently, Traffic Server unconditionally sets compiler optinizing flags, e.g. -O3 and ignores any setting the user might have given at build time through, e.g. CFLAGS.
The attached patch against the current trunk checks the environment for -O flags in C(XX)FLAGS and only sets them, if the user did not define any.
Note: I didn't test it on Solaris.