I tend to agree that if there's a civilization, there are laws, but your example is bizarre. A quick check of wikipedia informs us that Hammurabi was born circa 1810 BC. Compare Sargon, who took his throne about 500 years prior, or Narmer, who unified Egypt over a thousand years before Hammurabi was born. And we only know about them because they left records. The Egyptians also left records of various near-eastern peoples who clearly had flourishing civilizations at the time, but left no records of themselves. These great conquerors come from a backdrop of states that are already old.
Seven thousand years ago, pre-Egyptian nomads left religious art in what is now the Sahara desert (though at the time they used it to pasture their animals). Nomads aren't traditionally considered civilized; we like to use agriculture as the threshold. But those nomads surely had laws, even if you'd find them primitive, and they were organized enough to leave monuments behind and, eventually, conquer the farmers who lived along the Nile and set themselves up as the ruling class.