update to support switching compilers for file extensions

by default, *.c will be compiled by gcc,
and *.cpp & *.cc will be compiled by g++.