split compiler and linker flgas properly
add scanf() error checking and fix logic