enhance build process to allow selective -O3 optimization