Fixed small problems which exhibit themself when building projects with too many source files.

When there are too many source files and one builds static libraray cmake splits the whole list of files
into several invocations of library archiver. In order this to work cmake needs to know both how to create
and how to append to archive. Another related issue is that emscripten code fails when links a final
javascript code if a command line of a link command is too long (this 'too long' is very OS dependent).

Related discussion can be found in issue #1931.