./autogen.sh
./configure
make
If you are just compiling for yourself I would recommend a small change
./configure CFLAGS="-O3 -march=native" CXXFLAGS="-O3 -march=native"
This will optimize the binary as much as possible for your particular processor.
If the miner uses openssl for sha and aes, like the wallet miner, it doesn't make a difference.
BTW -Ofast usually brings a little improvement over -O3.