For more than a year, retiring Macy's (NYSE:M) CEO Terry Lundgren has been trying to rally his employees with the slogan, "A setback is a setup for a comeback." However, despite having led a remarkable comeback at Macy's after the Great Recession, Lundgren may be losing confidence in Macy's ability to recover from its recent declines in sales and earnings.

Indeed, with Macy's facing a potential proxy battle with activist fund Starboard Value, Lundgren is trying to sell the company, according to the New York Post. However, unless Macy's gets a really extraordinary offer, it would be better off waiting and continuing to execute its turnaround plan.

Macy's store

Macy's is trying to sell itself, according to recent reports. Image source: Macy's.

Macy's has a real plan

Based on Macy's recent earnings trajectory, it may seem like the company is in a tailspin. As of early January, management expected the company to post adjusted earnings per share of $2.95 to $3.10 for fiscal 2016, down from $4.40 two years earlier. At that time, the company also warned investors that comparable-store sales will probably decline again in 2017.

However, management is implementing deep cost cuts to cushion the earnings blow. It recently announced efficiency measures that should lead to annual savings of $550 million, with about $250 million of that total reinvested in growth initiatives. Macy's is also closing dozens of stores in the next few months, which will better align its retail footprint with current demand.

Most importantly, Macy's is in the early stages of selling off (and/or redeveloping) underutilized real estate. Just last quarter, real estate sales likely brought in proceeds of $400 million to $500 million for the company. And Macy's is still working on potential deals for its Manhattan and Chicago flagship stores -- properties that could be worth as much as $5 billion combined.

The Herald Square Macy's store

The Macy's flagship store in Manhattan. Image source: Macy's.

Cash flow remains strong

Macy's excess real estate -- properties that aren't pulling their weight when you compare the income they generate to the underlying real estate value -- could be worth billions of dollars. The company's real estate also provides a nice safety net for investors in case the retail business takes a turn for the worse.

On top of that, Macy's still generates about $1 billion of annual free cash flow. Yet its market cap has fallen to less than $10 billion, putting it at about nine times free cash flow. That seems extremely low, considering that free cash flow doesn't account for Macy's real estate value in any way.

M Market Cap Chart

Macy's Market Cap vs. Free Cash Flow data by YCharts.

Thus, Macy's is in pretty good position to stay the course. Meanwhile, it can appease investors by returning most or all of its free cash flow to shareholders through hefty dividends and share buybacks.

Who could be interested?

Finding a buyer who is willing to pay full value for Macy's may not be easy. Macy's is the largest U.S. department store company, so it would be tough for a rival to swallow it. Hudson's Bay Company has expressed interest in buying Macy's. But with a market cap of less than $2 billion, it's hard to see how it could come up with enough money to make an attractive offer.

TheStreet contributor Brian Sozzi has touted off-price giant Ross Stores (NASDAQ:ROST) as a potential acquirer, but this also seems far-fetched. Ross Stores is certainly big enough to acquire Macy's. However, the reason why department store chains are diversifying into the off-price market is because off-price is more profitable these days. There's no reason for Ross Stores to go in the other direction and get distracted with trying to fix Macy's.

A pure private equity deal might be feasible, but it would have to be one of the largest private equity deals in recent memory. Considering that Macy's stock traded as high as $45 just a few months ago, it would be foolish for the board to sell for less than $50. That would put the total price tag at around $15 billion -- and the acquirer would also have to assume about $7 billion of debt from Macy's.

The most interesting possibility to be floated is the idea of a private equity firm teaming up with real estate companies to buy Macy's. The bigger mall owners could each buy the Macy's stores at their own properties, another real estate investor could buy its flagship stores, and the private equity firm would get the rest of the company.

This scheme is the most plausible way that Macy's investors could get full value in a buyout. However, it would require cooperation between several different investors, which could be challenging to pull off.

Macy's doesn't need to sell itself to unlock value from its real estate, though. Unless it gets a great buyout offer, the company should keep executing its strategic plan by monetizing excess real estate while cutting costs. It could also participate in industry consolidation by buying other department store chains that may come on the auction block.

Giving activist investors like Starboard Value board representation may be unpalatable to Macy's current board members. However, it would be worth dealing with that complication if it buys Macy's enough time to stabilize its profitability.

Adam Levine-Weinberg owns shares of Macy's. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.