Ok. csm is helpful but not a magic bullet. I assumed that because "csm -program yamltest" worked without additional switches etc I could merely add -static to get a static build. Adding all.options and yamltest.options with the needed info works:
cat all.options
-program yamltest -C -I/usr/include
cat yamltest.options
L -L/usr/lib/x86_64-linux-gnu -L -lyaml -static -L -static -L -lm -L -ldl> ldd yamltest
$ file yamltest
yamltest: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=642844535ad617a9378ce2ff7a7616e74dcdd940, not stripped
Thanks Felix.