Homeland Security chief Michael Chertoff’s pledge of cooperation with the NYPD last week comes on the heels of a new “lovefest” between top FBI agents and city cops. It’s a big turnaround from what had been such a chilly relationship that police officials complained of terrorism investigations suffering from institutional spats. The former chief of the FBI field office, Pasquale “Pat” D’Amuro, and Commissioner Ray Kelly were rarely spotted at the same press conference. But D’Amuro was replaced by Mark Mershon, who notably showed up at the October 6 Bloomberg-Kelly announcement of the subway terror alert. Mershon, who called Kelly to bury the hatchet, says the G-men have conceded to Kelly on turf issues to present a unified public front: “We have a new attitude, a new posture.” The thaw also follows a personal sit-down between Kelly and FBI director Robert Mueller. Mueller’s new PR man as of August is none other than swashbuckling former journalist and ex-New Yorker John Miller. Miller didn’t return a call for comment, but a City Hall source credits him with helping ease tensions.