I understood this to have a nautical origin (it is used a lot in O'Brian and Forester's novels about the British Navy - if a pseudo-YART may be expressed here), coming from a jury-mast, used to temporarily replace a mast that has been shot through by cannon or otherwise rendered useless. Here's what I found in the American Heritage Dictionary:

From jury-rig, jury-rigging - improvised rigging on a ship, modeled on jury-mast, temporary mast, perhaps ultimately from Old French ajurie, help, from aider, to help.


Postscript: ARGHHAGH! Beaten to it by tsuwm by 72 seconds! Story of my life.