fixed linker option for latest gcc
modified for cout/cerr messages