Dozens of Massachusetts colleges are scrambling to find alternate ways to pay for research programs, campus construction, and other initiatives to make up for the loss of federal money once delivered through so-called earmarks.