The concept of "justified war" has too major problems:
1) If you accept it, how do you avoid the slippery slope? I can't think of a government in history that has avoided it.
2) If you don't accept it, how do you defend yourself from an aggressor?
The answer to #1 is #2--war is justified when used to defend yourself from an aggressor. The world agreed on this in the Charter of the United Nations, which is why every tinpot dictator now claims his wars are in "self-defense." That claim is what makes wars legal.
That being said, people disagree on what constitutes self-defense, and they lie about it, so you still have a problem.