Heat butter in a saucepan over medium heat until it foams. Stir in mushrooms and season with salt. Simmer until liquid evaporates, about 20 minutes.
Stir in flour; cook and stir for 5 minutes. Add 1 cup of beef stock, stirring briskly until incorporated, then pour in the remaining stock and mix thoroughly. Season with black pepper and thyme. Reduce heat to medium-low and simmer until thickened, stirring often, about 30 minutes.