Compiling a root macro

Is there a tutorial/example on how to compile, link, and execute (as a stand-alone program) a root macro?

By definition, a ROOT macro is a macro and not a main program.
See examples of main program in $ROOTSYS/test.
In general it is a very bad idea to write your own main program. I recommend using ACLIC like with

root > .X myscript.C+
see the very first pages of the Getting Started Manual