What distinguishes an unjust law from a law that we simply do not want to comply to?

{seesmic_video:{“url_thumbnail”:{“value”:”http://t.seesmic.com/thumbnail/oqquNGAHHS_th1.jpg”}”title”:{“value”:”question of the week “}”videoUri”:{“value”:”http://www.seesmic.com/video/DNiPczFYYi”}}}

Saint Augustine says : an unjust law should not be considered as a law. We equally see throughout history that many people rebelled against the system because they considered it unjust: Gandhi, Thoreau, Martin Luther King, Simon Bolivar. On the other hand a society needs laws in order to function – or else anarchy will rule. In your opinion, what distinguishes an unjust law from a law that we simply do not want to comply to?