This is Welcome to Mars (1967) by James Blish.
Dolph Haertel had made history. An incredible anti-gravity discovery, made entirely through his own efforts, had put him miles ahead of the professionals in the space race - and now he was setting off to prove his theories by travelling alone to Mars! The journey went perfectly - until Dolph actually landed on the Red Planet. There, he discovered a fault in his ship that couldn't be repaired without a vital - and missing - spare part. And Dolph Haertel, first Martian explorer, was marooned. His situation was critical. And his only hope lay with the one person to whom he had confided his secret of space travel. But would that person be able to find him in time...?

This review provides an overview of the plot that matches the general premise you described:
Seventeen, year-old Dolphe discovers the secret of anti-gravity and, fed up with NASA's fumblings, takes off for Mars in a reconverted packing case. He plans a four-hour expedition but, upon landing, discovers that he's blown an irreplaceable tube. For all his young genius he wasn't foresighted enough to bring along a spare. Meanwhile, back on Earth his girlfriend Nanette discovers what's happened and somehow ? pieces enough equipment together to follow him, taking the secret of anti-gravity with her, but leaving a note that shatters the parents and makes earth-shaking headlines. She crash lands and the two set out to survive: eating lichen that supply oxygen and slow down their metabolism etc.
This excerpt from the Google Books preview of the book itself describes how the anti-gravity drive was conceived of and then tested, inadvertently lifting the garage an inch off its foundations:
Dolph doodled with Milne, and Dingle, and the pitifully few others who had the courage to keep on thinking about gravity; and having been born into precisely the right moment, and having brought precisely the right mind to the right opportunity, fell into the fundamental discovery that although gravity is (as Einstein had maintained) a condition of space rather than a force like elecricity, it has polarity (which Einstein had broken his heart trying to disprove). It followed naturally that it could be manipulated, probably without too much work; since it was a weak field to begin with, and worked best only over very long distances, only a little effort should be required to produce desirable vector effects—
Or, that is, working with gravity rather than against it could probably be done in a garage, with only a few dollars. For example: a model space drive, capable of lifting perhaps a hundred pounds or more of dead weight, should be easy to assemble from standard television set parts, and other cheap, available components.
With Nanette's rather distracting help, he had assembled a small breadboard rig to test at least a few small margins of the notion. The rig worked only too well. It turned out to be well over a hundred times as efficient as he had dared to hope. In an eternal moment of groaning boards and squeaking nails, it had cut the whole garage off from the Earth and lifted it, both family cars included, a good inch off its foundations. The instant when the power cut off and the whole mass thudded back into place was even more alarming, but it was all that had saved the garage, Nanette and Dolph; he had had the rig plugged into a light socket, and the feeder line had parted before the frame building had pulled quite free of its concrete bedding.
And this excerpt describes how the tree-house was modified to serve as the hull of a spacecraft:
The tree-house was not much larger than the model, but it was altogether more elaborate. He meant it to take him into space, and to bring him back; he had no intention that it should kill him instead, if he could possibly avoid that. The floor of the exterior crate went into the tree first, as a platform (which, like the sides, had been sprayed with five layers of epoxy resins over the basic caulking — a horribly expensive procedure because he had been forced to buy the spray in household-size aerosol cans from the local supermarket, for the sake of secrecy). A sixth outside layer he had to mix himself; it consisted of high-purity zinc oxide in a silicone resin base, which, an article in Science had reported, would strongly reflect light in the wave-lengths between 0.20 and 0.80 microns, where about 66 per cent of the Sun's output was concentrated. Then the interior crate, similarly caulked, had been bedded on the platform in a nest of rock wool, the best he could do in the way of insulation (it would at least preserve some heat balance in space, though against hard radiation it would be worse than useless), and set about preparing his entrance lock and his porthole.