Abstract A (non-commutative) Ulam quasimorphism is a map $q$ from a group $\Gamma $ to a topological group $G$ such that $q(xy)q(y)^{-1}q(x)^{-1}$ belongs to a fixed compact subset of $G$. Generalizing the construction of Barge and Ghys, we build a family of quasimorphisms on a fundamental group of a closed manifold $M$ of negative sectional curvature, taking values in an arbitrary Lie group. This construction, which generalizes the Barge-Ghys quasimorphisms, associates a quasimorphism to any principal $G$-bundle with connection on $M$. Kapovich and Fujiwara have shown that all quasimorphisms taking values in a discrete group can be constructed from group homomorphisms and quasimorphisms taking values in a commutative group. We construct Barge-Ghys type quasimorphisms taking prescribed values on a given subset in $\Gamma $, producing counterexamples to the Kapovich and Fujiwara theorem for quasimorphisms taking values in a Lie group. Our construction also generalizes a result proven by D. Kazhdan in his paper “On $\varepsilon $-representations”. Kazhdan has proved that for any $\varepsilon>0$, there exists an $\varepsilon $-representation of the fundamental group of a Riemann surface of genus 2 which cannot be $1/10$-approximated by a representation. We generalize his result by constructing an $\varepsilon $-representation of the fundamental group of a closed manifold of negative sectional curvature taking values in an arbitrary Lie group.