A better makefile
I provided a simple makefile for you. Here is a better makefile with debug, sanitize, and release targets.
You can start with debug. But sanitize is the one you want.
Remember you can do
make clean (this deletes executable and objects)
make (defaults to debug)
make debug
make sanitize
make release
here is the file