Do Rite Realty
You have several options. FIRST: You can seek to renegotiate the price with the Seller(s) down to the appraised value. The Seller(s) may refuse this option thinking they could cancel the escrow with you and find a new Buyer(s). Your Realtor will need to point out to the Listing Agent the potential disadvantages to the Seller(s) should they refuse to lower the price and go this route. The Seller(s) will need to know that any new prospective Buyer(s) using financing to purchase, will need to have an appraisal and the chances of the shortfall showing up again are likely. The Seller's also will have to disclose the earlier appraisal shortfall to future Buyer(s). This includes all cash Buyer(s). And should your financing be FHA, your appraisal will be attached to the home for up to 6 months. Meaning the shortfall will not be avoided.The Seller's will start all over for no reason and could end up losing more money in the process.
SECOND: If you really love the home you could speak with your Realtor and Lender about coming in with a bigger down payment to cover the $40k appraisal shortfall. You could also ask the Seller(s) to meet you halfway by lowering the sale price by $20k. leaving you to come in with an additional $20k down to cover the shortfall. The Lender will have to approve this. I must also say it is my professional opinion that you DO NOT come in with an additional down payment over and above appraised value of the home. That being said, the choice ultimately comes down to you.
Your THIRD and final option should the Seller(s) refuse to lower the sales price down to the appraised value is to walk away and cancel the escrow. Now should you choose to walk away you must still have your appraisal contingency in effect and be within your inspection period (typically 17 days after offer acceptance unless otherwise agreed to in writing) to cancel the escrow and be entitled to get your initial good faith deposit back.
I hope my answer helps you and allows for you to make the best decision for you and your family. Good luck!