PHILADELPHIA — If you rebuild it, Mike will come.

After a year away from the NBA, former Knicks coach Mike D’Antoni has returned to the game . . . to help turn around the worst team in the league.

The 76ers confirmed Friday that the 64-year-old D’Antoni, who headed the Knicks from 2008 to 2012, is joining the team as an assistant under Brett Brown.

“Every time I called him . . . you could hear the crack of a 3-iron,” Brown said. “I think that we’re all wired the same. We need to be busy . . . When you ask him, ‘Why would you want to come in? We’re rebuilding? What’s your motive?’ — ‘I’m bored. I miss the game.’ ”

Brown said D’Antoni’s hiring was put into motion two weeks ago during Brown’s contract negotiation and shortly after Hall of Famer Jerry Colangelo joined the team as chairman of basketball operations.

Colangelo and Brown started sharing names of people who could help the 76ers, who fell to 1-27 with Friday night’s 107-97 loss to the Knicks and are in the middle of a long organizational rebuild.

advertisement | advertise on newsday

“He mentioned the name Mike D’Antoni,” Brown said. “I said, ‘Do you think he would do it? That’s a hell of a name.’ Less than 24 hours later, he came and said, ‘Mike is yours.’ The speed of it caught me way off guard.”

D’Antoni, Brown said, will help the team’s offense and offer a veteran influence on a relatively young staff, something that has long been on his wish list, he said. Young coaches, he said, are necessary on a team full of relative kids, but “we’ve always talked about having . . . maybe somebody with NBA experience, a graybeard type that I can personally talk to on maybe a different level — somebody that’s been around for a while.”

D’Antoni certainly fits the bill. He played for 17 years (13 of them in Italy) and was head coach for the Suns, Knicks and Lakers from 2003 to 2014. He was named coach of the year in 2005.

“I’m sure he’s excited to be back in the game,” said Knicks coach Derek Fisher, who said he doesn’t know D’Antoni personally. “He’s a really good basketball coach and I’m sure he’ll be helpful.”

D’Antoni spent the last two days in closed-door meetings with Brown and his assistant coaches but was not at Friday night’s game. He is officially expected to join the team during the 76ers’ next West Coast trip, which begins next week. Brown, for his part, can’t believe his luck.

NBA videos

“His availability caught me off guard,” he said. “This is a good thing. He’s a hell of a resource and a hell of a coach.”