I had a situation where I struggled to make my program run. So after a great struggle I got it working. Is this the correct statement I can use here? Or is there any other sentence like I made it work ? I got confused. Is there any other sentence that suits this situation?
Close, but no cigar!
The correct phrase to use is I got it working or I got it to work.
Also, at the beginning of your question, "I got a situation" should be I had a situation.
Dave Moore is correct, but if you want to use "made" instead of "got" you could say "I made it work". Also, since you are talking about a computer program, you could say "run" instead of "work" (work isn't wrong, but run seems more specific) or even "I debugged it".