Starting with Solaris 2.4, the package SUNWmfrun is included with the base OS. It is installed under the directory /usr/dt, where all the CDE stuff is installed (dt stands for desktop).
There are no Motif imake templates nor is mwm shipped with the base OS; only the mwm -like Dtwm is shipped.
Remember that you must link with -R/usr/dt/lib.