In C:\Program Files\Microsoft SQL Server\80\Tools\Binn, run rebuildm.exe.
For more info, read BOL.
The only gotcha mainly is when you browse for the mdf and ldf files... make sure they are not "read only"
After creating this new master mdb, you'll have no logins, databases, jobs, alerts, etc at all.
So hopefully you'll have restores of all databases to pull everything back form...