Assuming you have a C++ compiler on your machine
Assuming your file is named with the appropriate extension (.cc, .cpp, .C)
Assuming you are in a COMMAND LINE window
Assuming your file is in the CURRENT DIRECTORY (e.g., if you type "ls *.cpp" your file shows up)
Assuming (for example) the file is named "sample.cpp" (so "ls *.cpp" shows "sample.cpp")
THEN:
You can enter, "make sample"
and it should invoke the C++ compiler to create a binary executable program file named "sample" from the C++ source file named "sample.cpp".
GENERALLY you don't need a "Makefile" if all the above assumptions are valid. The "make" program defaults to looking for a list of possible source files that can be used to create the target, if there is no "Makefile" available. SOMETIMES that's not true, so it never hurts to actually create a "Makefile" for your specific program.
HOWEVER you don't need to use the "make" command either. You can enter:
gcc -o sample sample.cpp
which is essentially what the "make" command will do on your behalf (if all the above assumptions are valid).
BUT you might want to use "make" anyway, in which case, create a file named "Makefile" (no, you can NOT name it anything else -- well you can, but that's a lesson for another day)
Inside the "Makefile" include the following lines:
sample:{TAB}sample.cpp
{TAB}gcc -o sample sample.cpp
Where "{TAB}" is a physical Tab character (no, you can NOT substitute a bunch of spaces)
With those lines, you can fool around with where things are located, if you don't want to be in the same directory where the source is located, for example:
sample:{TAB}{FULL-PATH}/sample.cpp
{TAB}gcc -o sample {FULL-PATH}/sample.cpp
Once you have created your "Makefile" to your satisfaction, THEN your "make" command should work no matter where you placed the source file.