Makefile needs some tool to build, like nmake, Clearmake... Makefile (text file) alone cannot work, I am not asking that. why you need to build in makefile way, if you are looking for commandline type of building, VS supports it.
Also see WTSEnumerateSessions and WTSQueryUserToken in case you are interested in more than just the user logged into the console or your specific session from which the application is running.