Heat the butter and add the onions and garlic. Cook, stirring, until onions are wilted, about 5 minutes. Add the mushrooms, lemon juice, salt, pepper, parsley, thyme, and basil. Cook over relatively high heat, stirring frequently, until the liquid has almost completely evaporated, 8 to 10 minutes.
Add the ham and cook, stirring, about 4 minutes. Add