My own guess is that (if it's 1808) Vice-President Clinton, under his "President of the Senate" hat, counts the electoral votes, declares that Mr Madison and himself have been elected President and VP as from March 4, 1809, then simply adds a rider that due to Mr Madison's unfortunate death, the powers and duties of President will devolve upon himself as from that date. And that's what will happen.
If it does, of course, it will have consequences four years hence. Assuming that Clinton still dies in April 1812, the Presidency (or Acting Presidency [1]) will pass to William H Crawford as President of the Senate, which could lead to a tussle between him and Monroe for the 1812 nomination. If Crawford wins, then Monroe probably has to wait until 1820, and the 1824 free-for all is probably postponed to 1828.. If Monroe does, then Crawford is well placed to come back that year, ie before his stroke.
[1] Depending on whether Clinton does as Tyler did OTL, and claims the title of President, or merely calls himself "Vice President, Acting as President". I don't know enough about him to say which he'll do.