I doubt you could buy plywood, hardware and properly seal it for much less than a prebuilt unit. If you buy cheap plywood and don't seal it well, it will fall apart in a year or two. If you buy high quality marine plywood, the materials will cost more than a premade box.
Another vote for craigslist. When the truck we bought last year had a latch that wouldn't work we bought a notched V-gate for $40 which was cheaper than the parts to fix the old tailgate. (Ironically, we never came close to hitting the tailgate on the old truck but first time out we hit the v-gate. Luckily it just popped off the hinge with no damage.)