Regulate makefiles
Refactor ambiguous method on main.cpp