Semigroup C*-algebras arising from graphs of monoids