If it is thick caked on stuff use a screwdriver to scrape it off, lighter deposits can be removed with any number of solvents, lacquer thinner, brake cleaner etc. Use the solvent for the mating surfaces.
Just yesterday I ordered this material to make a custom gasket for a new turbo setup that I couldn't find the proper gaskets for. Don't know how it will work yet but it is cheap and has good reviews.
Amazon.com: Mr. Gasket 5961 Ultra Seal Exhaust Gasket Material: Automotive