You are not following specific instructions that would provide the desired out come.
I could make a guess that you are doing homework, but, maybe not...
Anyway, "tar demo123" will not do much.
Here is something to think about. Even if you successfully untarred the file, where do you think the contents of that tar file would go?
The answer is, all over your home directory. Could be a couple of files, could be hundreds. Feel like sorting around your home folder to figure out what was there BEFORE you untarred. Most folks don't.
Better safe than sorry. Move the tar file to a specifically created subdirectory like "my1stproject". cd to that directory then untar the file.
Typically (at least in old-school days
one would type something like:
tar -x demo123.tar ./
Hey! It's been a while! For more information about the tar command (preferably before you start this project) type:
man tar
When you have extracted the contents of the tar file, list the contents of the folder to see if there is a "configure" file in there. If so, then your configure command should then work fine.
You should know that this information you seek is not Mac specific. Give the rest of the unix.com forums a look, and use the unix.com search feature to locate information you are looking for.
We all had to learn somehow. Some of us had kindly tutors that patiently walked us through exercise after exercise, while others had someone to slap them on the back of the head for doing stupid stuff, and yet others had to smack themselves on the back of the head for doing stupid stuff.
Take your time and learn about the tools you are required to use.