Recent, readily available (but paywalled) corpora have shed some light on the origin of 'jerry-rig'. The phrase is, as stated elsewhere, distinct from 'jury-rig', although due to their similarity, the terms have been conflated in use. Research shows that 'jury-', in the form 'jury-mast', is more than 200 years older than 'jerry-', which first appeared 27 Apr 1832, in the form "Jerry Building Society" (but see following).
The meanings of the terms are also distinct, yet similar enough to result in the aforementioned conflation. The base definition of 'jury-' (in various constructions) is 'temporary', while 'jerry-' (likewise in various constructions) signifies 'makeshift, ramshackle'.
OED, in an entry first published in 1900 and not fully updated since, says this of the origin of 'jerry-builder':
Etymology: Origin not ascertained.
That jerry-builder and jerry-built originated in some way from the name Jerry is probable; but the statement made in a letter to the newspapers in Jan. 1884, that they commemorate the name of a building firm on the Mersey, has on investigation not been confirmed. The earliest example yet found is that of jerry-built 1869.
In a sardonic letter to the Liverpool Mercury, 27 Apr 1832 (paywalled), the first and only reference I could find to the "Jerry Building Society" appears, with this content describing a recent "Vestry Meeting":
There were the members of the Landlords' Club, the Blue Bell Club, the Jerry Building Society, &c: classical allusions to crockery-ware, with handles on one side: assertions by some that holding office had removed the scales from their before dark and prejudiced organs of vision.
An image of the entire letter, and an editorial response to it, may be found at the bottom of this answer.
Earlier that same year, Daniel O'Connell had established or recommended the establishment of "Landlords' Club", that is, clubs to control landlords, as indicated by this extract from a speech reported in the Tipperary Free Press, 31 Mar 1832 (paywalled):
...we shall have a landlords' club, and any man shall be blackbeaned [= blackballed, OED] who will turn out a good tenant.
I found no earlier mention of the "Blue Bell Club"; a later (28 Aug 1847), probably unrelated reference was to a club with an entry in an "Annual Procession of the Regatta Boats" in Manchester. No earlier or later references to the "Jerry Building Society" appear. All three, the "Landlords' Club", the "Blue Bell Club", and the "Jerry Building Society", were probably in the "Vestry" letter as topical and local, but oblique references to participants in the Vestry meeting that knowledgable readers of the Mercury could easily identify without their being named outright.
Building societies were first formed in England in the late 1700s. The organizations are described in Wikipedia:
The first building society to be established was Ketley's Building Society, founded by Richard Ketley, the landlord of the Golden Cross inn, in 1775. Members of Ketley's society paid a monthly subscription to a central pool of funds which was used to finance the building of houses for members, which in turn acted as collateral to attract further funding to the society, enabling further construction.
If my interpretation is accurate, the "Jerry" referred to by the author of the Vestry letter (signed "E.K.") was locally associated with a ramshackle, makeshift house, set of houses, or a builder of such houses. The author of the letter apparently desired to remain safe from an action for libel, as mentioned in later editorials from 13 July 1832 and 7 Jun 1833 (see following), addressed "To Correspondents" by the editors of the Mercury.
It is only after the 27 Apr 1832 Vestry letter that other references to "Jerry" buildings begin to appear. Like the Vestry letter, these references show up in the Liverpool Mercury (all links paywalled):
13 Jul 1832: Jerry Buildings. — A friend wishes us to call the attention of the magistrates or the surveyors, or of any other persons whose duty it is to look after such things, to some wretchedly built houses in the Park, which stand an excellent chance of being blown down by the first puff of wind. We are sorry that we dare not point out the place where this nuisance exists, or name the persons who thus sport with the lives of the community. Were we to do either, we should, in the present blessed state of the libel law render ourselves liable to an action for damages, in which case the chances would be ten to one that the verdict would go against us, however successfully we could demonstrate that our only motive for exposing the knavery was a wish to promote the public good. Under these circumstances we must confine ourselves to mere general statement. Houses of the slightest construction, formed of the worst materials, are run up in all directions, and the only wonder is that accidents, as they are termed, are not of more frequent occurrence. What are the surveyors about? Is their office a sinecure, or do the Jerry builders afford them so much occupation that they cannot possibly attend to it all, and therefore neglect it altogether.
7 Jun 1833: Jerry Buildings — The publication of the letter of a Constant Reader might subject us to an action, if the jerry-builder [emphasis mine] should take offence at it. We have forwarded it to the Commissioners of Watch, Lam, and Scavengers.
21 Jun 1833 (in an article titled "The Trades Union Society"): Another evil of the system is, that the cupidity of some of the masters prompts them to task and tyrannize over their men, allowing them too little time to make a good job; witness what you call Jerry buildings [emphasis mine], blown up like bottles or balloons, without that substantiality and convenience which give security and comfort to the inhabitants.
The foregoing from the 1830s Liverpool Mercury are the earliest attestations of the phrase I found. The term is picked up and spreads, first to the Liverpool Mail (8 Nov 1845), then beyond.
First appearance, the "Jerry Building Society":