[profiler] Actually link against libmono where necessary (#3232)