Add optimization -O2 to generic configure script